<?php



namespace App\Http\Requests\ApiV2;


use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;


class BatchVideoRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'course_id' => 'required',
            'chapter_id' => 'required',
            'category_id' => 'required',
            'my_category_id' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'course_id.required' => __('请输入课程id'),
            'chapter_id.required' => __('请输入章节id'),
            'category_id.required' => __('请输入分类id'),
            'my_category_id.required' => __('请输入我的分类id'),


        ];
    }

    public function filldata()
    {
        return [
            'company_id' => $this->header('company_id', 0),
            'user_id' => Auth::id(),
            'course_id'=>$this->input('course_id',0),
            'chapter_id'=>$this->input('chapter_id',0),
            'my_category_id' => $this->input('my_category_id'),
            'category_id' => $this->input('category_id'),
            'videos' =>(array) $this->input('videos',[]),

        ];
    }
}
